import 'package:flutter/material.dart';

// 定义有状态组件
// 快捷键：fstfull，得安装插件：Flutter Widget Snippets
class HomePage03 extends StatefulWidget {
  const HomePage03({Key? key}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage03> {
  // 状态变量
  int count = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Container组件', style: TextStyle(color: Colors.white)),
        backgroundColor: Colors.blue,
      ),
      body: Container(
        width: 300,
        height: 300,
        // color: Colors.orange,
        // 外间距，上下左右间距，单位跟设备有关，鸿蒙是vp
        margin: EdgeInsets.all(20),
        // 内间距
        // padding: EdgeInsets.all(40),
        padding: EdgeInsets.only(left: 40, top: 40),
        alignment: Alignment.center,
        // 设置圆角
        decoration: BoxDecoration(
          // 一旦使用了decoration，背景色就要在这里定义
          color: Colors.orange,
          borderRadius: BorderRadius.circular(20),
          border: Border.all(color: Colors.red, width: 5),
        ),
        child: Text('Inner'),
      ),
    );
  }
}
